package com.victor.bookretail.domain;

import lombok.Getter;

import java.util.Arrays;
import java.util.Set;
import java.util.stream.Collectors;

/**
 * The type of customer
 */
@Getter
public enum UserTypeEnum {

    GOLD("Gold", "Gold Customer"),
    SILVER("Silver", "Silver Customer"),
    COPER("Coper", "Coper Customer");

    //code for type
    private String code;
    //description for type
    private String desc;

    UserTypeEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static Set<String> getAllUserTypeCodes() {
        return Arrays.stream(UserTypeEnum.values())
                .map(UserTypeEnum::getCode)
                .collect(Collectors.toSet());
    }
}
